#!/usr/bin/python
#coding=utf-8

from model.dbutils import DBUtils

class Account(object):

    def __init__(self, uid, balance=0):
        self.uid = uid
        self.balance = balance
        self.dbutils = DBUtils()

    def insert(self):
        sql = """
            INSERT INTO account(uid, balance) values(%s, %s)
            """
        values = (self.uid, self.balance)
        rows = self.dbutils.execute(sql, values)
        if rows is None:
            return False
        else:
            return True

